package Enum_;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class EnumExercise02 {
    public static void main(String[] args) {
        Weeek[] values = Weeek.values();
        System.out.println("===所有星期信息如下===");
        for (Weeek weeek:values){
            System.out.println(weeek.toString());
        }

    Music.CLASSICMUSIC.playing();
    }
}
enum Weeek{
    MONDAY("星期一"),
    TUESDAY("星期二"),
    WEDNESDAY("星期三"),
    THURSDAY("星期四"),
    FRIDAY("星期五"),
    SATURDAY("星期六"),
    SUNDAY("星期日");

    private String name;

    Weeek(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }
}


interface IPlay{
    void playing();
}
//枚举类不能继承别的类但是可以实现接口
//枚举中的方法要通过枚举常量去调用
enum Music implements IPlay{
    CLASSICMUSIC;

    @Override
    public void playing() {
        System.out.println("夜曲..");
    }
}
